<%--
  Created by IntelliJ IDEA.
  User: 22531
  Date: 2021/6/10
  Time: 0:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="/easyui/themes/icon.css">
    <script type="text/javascript" src="/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/js/datagrid-export.js"></script>

    <script src="/easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">
        $(function (){
            $('#teaClazz').datagrid({
                url:'/tea/getTeaClazzStu',
                columns:[[
                    {field:"id",align:"center",title:'学生ID'},
                    {field:"sno",align:"center",title:'学号'},
                    {field:"name",align:"center" ,title:'姓名'},

                ]],
                rownumbers:true,
                pagination: true,
                pageSize:64,
                pageList:[64,100,200,300],
                singleSelect: true,
                toolbar: '#toolbar',
                queryParams: {
                    clazz_id: $('#c').val(),
                }
            });
        })
    </script>
</head>
<body>
<div class="easyui-panel" data-options="fit:true,border:false">
    <table id="teaClazz" ></table>
</div>
<div id="toolbar">
    <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-reload" plain="true" onclick="myReload()">刷新</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" plain="true">班级：</a>
    <input id="c" class="easyui-combobox" data-options="
                    url:'/tea/getTeaClazzName?tea_id=${sessionScope.tea.id}',
                    method:'get',
                    valueField:'id',
                    textField:'name',
                    panelHeight:'auto',

                    labelPosition: 'top',
                    required:true,
                    editable:false,
                    value:1,
                    ">
    <a href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-excel'" onclick="$('#teaClazz').datagrid('toExcel','dg.xls')">ExportToExcel</a>
</div>

<script type="text/javascript">
    function myReload(){
        $('#teaClazz').datagrid('reload');
    }

    $('#c').combobox({
        onChange: function(newValue,oldValue){
            $('#teaClazz').datagrid('load',{
                clazz_id: $('#c').val(),
                }
            );
        }
    });

</script>
</body>
</html>
